from SeleniumDemo.auth_proxy import co
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from lxml import etree
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
import time
from selenium.webdriver.common.action_chains import ActionChains
import csv
from fake_useragent import UserAgent
from PIL import Image  # 用于打开图片和对图片处理
from aip import AipOcr
import pandas as pd


# chrome_options = Options()
# # chrome_options.add_argument('--headless') # 无头模式
# chrome_options.add_argument('--disable-gpu')
# chrome_options.add_experimental_option('excludeSwitches', ['enable-automation']) # 设置开发模式，避免被检测
# chrome_options.add_argument('User-Agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"')
# driver = webdriver.Chrome(chrome_options=chrome_options) # 已经设置PATH环境变量
# 未在PATH环境变量中设置，需要设置驱动可执行路径
driver = webdriver.Chrome(executable_path='D:\\webdriver\\chromedriver.exe', chrome_options=co)
# driver.maximize_window()  # 窗口最大化
for i in range(1, 10):
    # driver = webdriver.Chrome(chrome_options=co)
    driver.get("http://www.moguproxy.com/proxy/test/aaa")
    time.sleep(3)

